<template>
  <div class="td-doctor-me-appointment-record">
    <td-divider v-if="appointmentRecordList.length===0" style="margin-top:100px;">暂无数据</td-divider>
    <div class="list" v-if="appointmentRecordList.length!==0">
      <div class="item" v-for="(item,index) in appointmentRecordList" :key="index">
        <h2>
          {{item.num}}、{{item.AppointmentItemName}}
          <span>￥{{utils$.subTransfer(item.ItemPrice)}}</span>
        </h2>
        <div>
          订单号：{{item.OrderNumber}}
          <el-tag v-if="item.OrderStatus===0" type="warning">未支付</el-tag>
          <el-tag v-if="item.OrderStatus===1" type="success">支付成功</el-tag>
          <el-tag v-if="item.OrderStatus===2" type="info">支付失败</el-tag>
          <el-tag v-if="item.OrderStatus===3" type="danger">退款中</el-tag>
          <el-tag v-if="item.OrderStatus===4">已退款</el-tag>
        </div>
        <div>
          预约时间：{{item.AppointmentDate.split('T')[0]}}
          <label v-if="item.TimeType===0">08:30~12:00</label>
          <label v-if="item.TimeType===1">13:00~16:30</label>
          <label v-if="item.TimeType===2">18:30~21:30</label>
        </div>
        <div>预约医院：{{item.HospitalName}}</div>
        <div>病例所在地：{{item.RecordHospitalName}}</div>
        <div>是否怀孕：{{item.IsPregnancy===0?'否':'是'}}</div>
        <div>
          支付平台：
          <label v-if="item.PayPlatform===0">微信</label>
          <label v-if="item.PayPlatform===1">支付宝</label>
          <label v-if="item.PayPlatform===2">添丁</label>
        </div>
        <div>
          支付方式：
          <label v-if="item.PayType===0">JsApiPay</label>
          <label v-if="item.PayType===1">NativePay</label>
          <label v-if="item.PayType===2">APPPay</label>
          <label v-if="item.PayType===3">POS刷卡</label>
          <label v-if="item.PayType===4">支付宝转账</label>
          <label v-if="item.PayType===5">现金支付</label>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import AppointmentRecordService from "../../../../_services/appointmentRecord.service";
export default {
  name: "TianDingDoctorMeAppointmentRecordComponent",
  data() {
    return {
      user: {},
      appointmentRecordList: []
    };
  },
  mounted() {
    this.user = JSON.parse(this.local$.getItem("tdUser"));
    this.getAppointmentRecordListByDoctorID();
  },
  methods: {
    getAppointmentRecordListByDoctorID() {
      let params = {};
      params.pageIndex = 1;
      params.pageSize = 100;
      params.doctorID = this.user.DoctorID;
      AppointmentRecordService.getAppointmentRecordListByDoctorID(params).then(
        response => {
          if (response.Data.Items.length > 0) {
            this.appointmentRecordList = response.Data.Items;
          }
        }
      );
    }
  }
};
</script>

 